草庐IT

java - 无法确定 Hibernate PersistenceProvider

全部标签

ruby-on-rails - PostgreSQL gem pg 无法安装

我的数据库是PostgreSQL。我在CENTOS上...。在安装pggem时,我收到以下错误。我也重新安装以清除我的YAML问题,但没有用,但这只是一个警告。我的主要问题是pggem的安装:[root@vdimc04~]#geminstallpg/usr/local/lib/ruby/1.9.1/yaml.rb:56:in`':Itseemsyourrubyinstallationismissingpsych(forYAMLoutput).Toeliminatethiswarning,pleaseinstalllibyamlandreinstallyourruby.Buildingn

ruby - 安装后无法使用 compass

我似乎无法使用thisVagrantfile使compass在Vagrant上工作.请在此处查看其余的bash脚本(已删除repo)(如果您想配置您的VagrantUbuntuBox,请参阅Vaprobash!)。因此,当我不得不使用gruntserver时,我正在学习gruntjs类(class)。唯一的问题是它需要更新的ruby​​版本(我相信是1.9+而不是1.8)并且它需要compass。所以我通过安装RVM和安装最新的稳定版本解决了ruby​​部分。compass应该很容易获得geminstallcompass并且它似乎确实已安装。但是当我输入compass-v时,我得到了休

ruby-on-rails - 升级到 Yosemite 10.10 后无法连接到 postgresql 数据库

更新到Yosemite10.10后,我无法连接到我的postgresql数据库。我运行Rails控制台并尝试获取第一个用户,但出现此错误...>➜game_golfgit:(master)✗railsc>Loadingdevelopmentenvironment(Rails4.1.4)>[1]pry(main)>User.first>PG::ConnectionBad:couldnotconnecttoserver:Connectionrefused>Istheserverrunningonhost"localhost"(::1)andaccepting>TCP/IPconnectio

ruby - 无法在 Eclipse 4.2 上安装 Aptana 插件

我已经安装了Eclipse4.2Juno。现在我想安装aptana来开发ruby,但是我得到以下错误,Unabletoreadrepositoryathttp://download.aptana.com/studio3/plugin/install/content.jar.无法读取位于http://download.aptana.com/studio3/plugin/install/content.jar的存储库.读取超时 最佳答案 我认为到目前为止您可能已经解决了问题,但我遇到了完全相同的问题并在多次搜索后找到了解决方案,所以为了

ruby - 确定字符串数组是否包含 ruby​​ 中的某个子字符串

我有一个简单的ruby​​问题。我有一个字符串数组。我想确定该数组是否包含任何字符串的子字符串。举个例子a=['cat','dog','elephant']a.to_s.include?('ele')这是最好的方法吗?谢谢。 最佳答案 a.any?应该可以完成这项工作。>a=['cat','dog','elephant']=>["cat","dog","elephant"]>a.any?{|s|s.include?('ele')}=>true>a.any?{|s|s.include?('nope')}=>false

ruby-on-rails - 确定字符串是否为有效的浮点值

有没有一种方法可以简单地检查字符串值是否是有效的浮点值。如果字符串不是数值,则对字符串调用to_f会将其转换为0.0。使用Float()会在传递一个更接近我想要的无效浮点字符串时引发异常,但我不想处理捕获异常。我真正想要的是像nan这样的方法?它确实存在于Float类中,但这无济于事,因为如果不将非数字字符串更改为0.0(使用to_f),则无法将其转换为float。"a".to_f=>0.0"a".to_f.nan?=>falseFloat("a")=>ArgumentError:invalidvalueforFloat():"a"对此是否有简单的解决方案,或者我是否需要编写代码来检查

ruby-on-rails - 运行 heroku create --stack cedar 时无法加载此类文件 -- readline (LoadError)

我正在尝试将我的Rails应用程序部署到Heroku以按照以下说明进行测试:http://devcenter.heroku.com/articles/rails3#prerequisites这是我要运行的命令:herokucreate--stackcedar我收到此错误消息:/home/sergio/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in`require':cannotloadsuchfile--readline(LoadError)from/home/s

ruby - 无法在生产服务器上更新 gem

无法在生产服务器上更新gem。我已经尝试过bundleinstall--deployment和bundleinstall--withoutdevelopmenttest但不断得到:YouaretryingtoinstallindeploymentmodeafterchangingyourGemfile.Run`bundleinstall`elsewhereandaddtheupdatedGemfile.locktoversioncontrol.Ifthisisadevelopmentmachine,removetheGemfilefreezebyrunning`bundleinstal

ruby - 在 Ruby 中,如何确定字符串是否不在数组中?

在Ruby中,如果字符串不在选项数组中,我如何返回true?#pseudocodedo_thisifcurrent_subdomainnot_in["www","blog","foo","bar"]...或者您知道更好的写法吗? 最佳答案 do_thisunless["www","blog","foo","bar"].include?(current_subdomain)或do_thisifnot["www","blog","foo","bar"].include?(current_subdomain)我正在使用Array#incl

ruby-on-rails - 没有 sudo,Bundler 无法安装任何 gem

我正在尝试安装一个Rails应用程序,但每次我使用bundle时,如果没有sudo,它就会失败。我目前的情况是,只要对所有使用sudo,包括rails,一切都会正常。我认为这是不正确的。例如:$bundleupdateUpdatinggit://github.com/refinery/refinerycms.gitFetchinggemmetadatafromhttps://rubygems.org/.......Fetchinggemmetadatafromhttps://rubygems.org/..Resolvingdependencies...Enteryourpassword